package com.csx.micrometer.database.config;

import com.csx.micrometer.database.timer.DatabasesMonitor;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @author cuisongxu
 * @date 2023/3/14 19:42
 */
@EnableConfigurationProperties(value = MicrometerDatabaseProperties.class)
@Configuration
public class MicrometerDatabaseConfiguration {

    @Bean
    public DatabasesMonitor databasesMonitor(MicrometerDatabaseProperties micrometerDatabaseProperties) {
        return new DatabasesMonitor(micrometerDatabaseProperties);
    }
}
